import java.util.ArrayList;
import java.util.TreeMap;


public class ThreeMapMemory {
	public static void main(String[] args) throws InterruptedException {
		long j;
		System.gc();
		j = Runtime.getRuntime().freeMemory();
		TreeMap<Integer,Integer> list = new TreeMap();
		for (int i = 0; i < 1000; i++) {
			list.put(i, i);
		}
		System.gc();
		System.out.println(j-Runtime.getRuntime().freeMemory());
		Thread.sleep(1000);
		System.gc();
		j = Runtime.getRuntime().freeMemory();
		System.out.println(j);
		TreeMap<Integer,Integer> list1 = new TreeMap();
		for (int i = 0; i < 1000; i++) {
			list1.put(i, i);
		}
		System.gc();
		System.out.println(j-Runtime.getRuntime().freeMemory());
	}
}
